package com.scott.Factory.simple;


import com.scott.Factory.product.AudiCar;
import com.scott.Factory.product.BMWCar;
import com.scott.Factory.product.BenzCar;
import com.scott.Factory.product.Car;

public class CarFactory {

    public Car getCar(String name) {
        if (name.equalsIgnoreCase("benz")) {
            return new BenzCar();
        } else if (name.equalsIgnoreCase("bmw")) {
            return new BMWCar();
        } else if (name.equalsIgnoreCase("audi")) {
            return new AudiCar();
        } else {
            return null;
        }

    }
}
